<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit" />
  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
  <link rel="icon" type="image/png" href="img/app-icon72x72.png" />
  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes" />
  <link rel="icon" sizes="192x192" href="img/app-icon72x72@2x.png" />
  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="apple-mobile-web-app-title" content="标题" />
  <link rel="apple-touch-icon-precomposed" href="/img/app-icon72x72@2x.png" />
  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="/img/app-icon72x72@2x.png" />
  <meta name="msapplication-TileColor" content="#0e90d2" />
  <meta name="viewport" content="width=1200, user-scalable=yes">
  <title>我的评论</title>
  <meta name="description" content="" />
  <meta name="keywords" content="" />
  <!-- /meta -->
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/pace.min.js"></script>
  <link
    href="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/pace-theme-minimal.min.css"
    rel="stylesheet">
  <!--[if lte IE 9]>
  <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
  <!--[if gt IE 9]><!-->
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/jquery.3.3.1min.js"></script>
  <!--<![endif]-->
  <!-- /script -->
  <link rel="stylesheet" href="css/main.min.css">
  <!-- /style -->
</head>

<body>
  <div class="page page-volunteer-register">


    <section class="common_header_item">

      <header class="page__header">
      </header>
    </section>
    <!-- /header -->
    <main class="page__container">
      <section class="section section__breadcrumb">
        <div class="section__wrapper">
          <div class="pure-u-1">
            <div class="column-inner">
              <div class="nav__breadcrumb">
                <a class="item" href="index.html">首页</a>
                <span class="separator">&gt;</span>
                <a class="item active" href="javascript:void(0)">我的评论</a>
              </div>
            </div>
          </div>
        </div>
      </section>
      <!-- / breadcrumb -->
      <section class="section">
        <div class="section__wrapper">
          <div class="pure-u-1-6">
            <div class="column-inner">
              <div class="page-usercenter-left">
                <div class="usercenter-user">
                  <div class="usercenter-user_portrait">
                    <p>
                      <img src="http://via.placeholder.com/108x108" class="avatar" alt="" width="108" height="108" />
                      <a class="link"><i class="iconfont">&#xe67a;</i></a>
                    </p>
                    <span>用户昵称</span>
                  </div>
                </div>
                <div class="usercenter-user_type">
                  <ul class="userInfo-div-menuList">
                    <li><a href="user-center-order.html"><i class="iconfont">&#xe677;</i>我的订单</a>
                    </li>
                    <li><a href="user-center-favorite.html"><i class="iconfont">&#xe870;</i>我的收藏</a>
                    </li>
                    <li class="active"><a href="user-center-comment.html"><i class="iconfont">&#xe606;</i>我的评论</a>
                    </li>
                    <li><a href="user-volunteer-archive.html"><i class="iconfont">&#xe647;</i>我的志愿者</a>
                    </li>
                    <li><a href="user-center-team.html"><i class="iconfont">&#xe647;</i>我的社团</a>
                    </li>
                    <li><a href="user-center-profile.html"><i class="iconfont">&#xe67a;</i>个人设置</a>
                    </li>
                    <li><a href="general-certify.html"><i class="iconfont">&#xe6c3;</i>实名认证</a>
                    </li>
                    <li><a href="#"><i class="iconfont">&#xe6eb;</i>退出</a>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
          <!-- /user-center-left -->
          <div class="pure-u-5-6">
            <div class="column-inner">
              <div class="module module__user_center">
                <div class="module module__user_title" id="type">
                  <a href="#" class="v-item active">全部 </a>
                  <a href="#" class="v-item " state="2">审核通过</a>
                  <a href="#" class="v-item " state="4">审核失败</a>
                  <a href="#" class="v-item " state="3">未审核</a>
                </div>
                <div class="module module__user_container">
                  <div class="media-list" id="comment"></div>
                </div>
                <nav class="page-pagination" aria-label="page-pagination" id="page">

                </nav>
                <!-- / pagination -->
              </div>
            </div>
          </div>
        </div>
      </section>
    </main>

    <footer class="page__footer">
    </footer>
    <!-- / footer -->
  </div>
  <!-- /page -->

  <script
    src="https://culturetv.hanyastar.com.cn/national_culture_file/pcjs/underscore-min-1.8.3/underscore-min.js"></script>
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/bowser.min.js"></script>
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/swiper3.4.2.jquery.min.js"></script>
  <link
    href="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/swiper3.4.2.min.css"
    rel="stylesheet">
  <script src="https://culturetv.hanyastar.com.cn/national_culture_file/pcjs/layer-3.0.3/layer.min.js"></script>



  <!-- 前端交互脚本 -->
  <script src="js/common/xtab.js"></script>
  <script src="js/common/xbar.js"></script>
  <script src="js/common/util.js"></script>

  <script src="js/app.js"></script>
  <script src="js/common.min.js"></script>
  <script src="js/common.js"></script>
  <script src="js/page-footer.js"></script>
  <script src="js/page-header.js"></script>
  <script src="js/page-center.js"></script>
  <script src="js/util/page-helper.js"></script>

  <!-- /script -->
  <!-- <script type="text/html" id="tplTeml">
    <div class="media media__type_06 media-bg-white media-normal media-card media__activity">
      <div class="caption">
        <div class="headline">
          <div href="#" target="_blank" class="singleline pure-u-11-12">浙江省未成年人“戏曲阅读经典”大赛决赛</div>
          <div class="tag_btn tag_delete j_delete pure-u-1-12">
            <i class="iconfont">&#xe602;</i>删除
          </div>
        </div>
        <div class="abstract">
          <p class="text">2018年8月5日晚七点30分，广西文广新局、文化馆主办的2018夏季首届纳凉晚会在我县市民广场举行。首届纳凉晚会为了提高我县市民的文化生活质量、展现市民的精神面貌、丰富居民的文化活动和打造文化凤阳、绿色凤阳、大美凤阳而精心举办的。前来观看这台晚会的观众坐无虚席，广场上挤满了人。晚会也请来了许多音乐名人、舞蹈家、相声名家等参加演出，独唱、合唱、古筝表演、街舞、架子鼓还有我县的艺术特色凤阳花鼓等节目。
          </p>
          <p class="singleline">活动时间：2019.02.12-2019.02.13</p>
        </div>
      </div>
    </div>
  </script> -->
</body>
<script>


  $(document).ready(function () {
    // 模拟ajax
    // function ListDate(obj, sql, num) {
    //   var tpl = "";
    //   for (var i = 0; i < num; i++) {
    //     tpl += $('#' + sql).html();
    //   }
    //   $('.' + obj).append(tpl);
    // }
    // ListDate('media-list', 'tplTeml', 3);

    //  --------  ------

    // var userId = getLocalCookieUserId();
    // request.setRequestHeader("userId", userId);
    var pageParms = getPageParms();
    var parms = {
      'state': null,//2 通过 3 不通过
      'pageSize': 2,//每页条数
      'pageNumber': 1,//页码
    }
    LoadHtml()
    function LoadHtml() {
      commonAjax({
        type: 'GET',
        url: '/api/user/comment_list'
      }, parms, (request) => {
        // var userId = getLocalCookieUserId();
        // request.setRequestHeader("userId", userId);
        request.setRequestHeader("userId", 1);
      }, (data) => {
        var list = data.data;
        pageParms.currPage = data.currPage;
        pageParms.total = data.total;
        pageParms.totalPage = data.totalPage;
        pageParms.pageSize = data.pageSize;
        page(pageParms, "page");
        var html = '';
        $(list).each((index, item) => {
          html += '<div class="media media__type_06 media-bg-white media-normal media-card media__activity">' +
            '<div class="caption">' +
            '<div class="headline">' +
            '<div href="#" target="_blank" class="singleline pure-u-11-12">' + item.title + '</div>' +
            '<div class="tag_btn tag_delete j_delete pure-u-1-12">' +
            '<i class="iconfont" onclick="javascript: deleteCid(' + item.id + ');" cId="' + item.id + '">&#xe602;</i>删除' +
            '</div> </div>' +
            '<div class="abstract">' +
            '<p class="text">' + item.comment +
            '</p>' +
            '<p class="singleline">评论时间：' + item.createTime +
            '</p>' +
            '</div></div></div>';
        })
        $("#comment").html(html);
      });
    }

    $("#type").on("click", "a", function (e) {
      var $this = $(this);
      var state = $this.attr("state")
      parms.state = state;
      LoadHtml()
      e.preventDefault();
    });


    $(".j_delete").on("click", "i", function (e) {
      var $this = $(this);
      var id = $this.attr("cId")
      deleteCid(id)
      LoadHtml()
    });


    onPage("page", pageParms, parms, LoadHtml);
    $('.v-item ').on('click', function () {
      $(this).addClass('active').siblings().removeClass('active');
    });
  });

  function deleteCid(id) {
    var msg = "您真的确定要删除吗？";
    openOK(msg, () => {
      commonAjax({
        type: 'POST',
        url: 'api/user/del_comment'
      }, { 'id': id }, (req) => {
        req.setRequestHeader("userId", 1)
      }, (data) => {
        window.location.reload()
      })
    });
  }
</script>

</html>